// pages/DAS28assessment/DAS28assessment.js
var app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    dianOne: false,
    dianTwo: false,
    dianThree: false,
    dianFour: false,
    dianFive: false,
    dianSix: false,
    dianSeven: false,
    dianEight: false,
    dianNine: false,
    dianTen: false,
    addNum:0
  },
  position1: function (e) {
    if(this.data.dianOne == false) {
      this.data.addNum++
    }else {
      this.data.addNum--
    }
    this.setData({
      dianOne: !this.data.dianOne,
      addNum:this.data.addNum
    })
  },
  position2: function (e) {
    if (this.data.dianTwo == false) {
      this.data.addNum++
    } else {
      this.data.addNum--
    }
    this.setData({
      dianTwo: !this.data.dianTwo,
      addNum:this.data.addNum
    })
  },
  position3: function (e) {
    if (this.data.dianThree == false) {
      this.data.addNum++
    } else {
      this.data.addNum--
    }
    this.setData({
      dianThree: !this.data.dianThree,
      addNum:this.data.addNum
    })
  },
  position4: function (e) {
    if (this.data.dianFour == false) {
      this.data.addNum++
    } else {
      this.data.addNum--
    }
    this.setData({
      dianFour: !this.data.dianFour,
      addNum: this.data.addNum
    })
  },
  position5: function (e) {
    if (this.data.dianFive == false) {
      this.data.addNum++
    } else {
      this.data.addNum--
    }
    this.setData({
      dianFive: !this.data.dianFive,
      addNum: this.data.addNum
    })
  },
  position6: function (e) {
    if (this.data.dianSix == false) {
      this.data.addNum++
    } else {
      this.data.addNum--
    }
    this.setData({
      dianSix: !this.data.dianSix,
      addNum: this.data.addNum
    })
  },
  position7: function (e) {
    if (this.data.dianSeven == false) {
      this.data.addNum++
    } else {
      this.data.addNum--
    }
    this.setData({
      dianSeven: !this.data.dianSeven,
      addNum: this.data.addNum
    })
  },
  position8: function (e) {
    if (this.data.dianEight == false) {
      this.data.addNum++
    } else {
      this.data.addNum--
    }
    this.setData({
      dianEight: !this.data.dianEight,
      addNum: this.data.addNum
    })
  },
  position9: function (e) {
    if (this.data.dianNine == false) {
      this.data.addNum++
    } else {
      this.data.addNum--
    }
    this.setData({
      dianNine: !this.data.dianNine,
      addNum: this.data.addNum
    })
  },
  position10: function (e) {
    if (this.data.dianTen == false) {
      this.data.addNum++
    } else {
      this.data.addNum--
    }
    this.setData({
      dianTen: !this.data.dianTen,
      addNum: this.data.addNum
    })
  },
  next:function () {
    var that = this;
    if(that.data.dianOne == true){
      app.d.ya_left_1 = 1;
    }else{
      app.d.ya_left_1 = 0;
    }
    if (that.data.dianTwo == true) {
      app.d.ya_left_2 = 1;
    } else {
      app.d.ya_left_2 = 0;
    }
    if (that.data.dianThree == true) {
      app.d.ya_left_3 = 1;
    } else {
      app.d.ya_left_3 = 0;
    }
    if (that.data.dianFour == true) {
      app.d.ya_left_4 = 1;
    } else {
      app.d.ya_left_4 = 0;
    }
    if (that.data.dianFive == true) {
      app.d.ya_left_5 = 1;
    } else {
      app.d.ya_left_5 = 0;
    }
    if (that.data.dianSix == true) {
      app.d.ya_right_1 = 1;
    } else {
      app.d.ya_right_1 = 0;
    }
    if (that.data.dianSeven == true) {
      app.d.ya_right_2 = 1;
    } else {
      app.d.ya_right_2 = 0;
    }
    if (that.data.dianEight == true) {
      app.d.ya_right_3 = 1;
    } else {
      app.d.ya_right_3 = 0;
    }
    if (that.data.dianNine == true) {
      app.d.ya_right_4 = 1;
    } else {
      app.d.ya_right_4 = 0;
    }
    if (that.data.dianTen == true) {
      app.d.ya_right_5 = 1;
    } else {
      app.d.ya_right_5 = 0;
    }
    wx.redirectTo({
      url:'../DAS28assessmentTwo/DAS28assessmentTwo'
    })
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
  
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  
  }
})